using System;
using System.Collections.Generic;

namespace B.S.XZYData.Api.Read.Dto.Plan
{
    /// <summary>
    /// 生产计划详情DTO（包含明细列表）
    /// </summary>
    public class PlanDetailDto
    {
        /// <summary>
        /// 主键ID
        /// </summary>
        public int Id { get; set; }

        /// <summary>
        /// 计划单号
        /// </summary>
        public string Code { get; set; }

        /// <summary>
        /// 备注
        /// </summary>
        public string? Remark { get; set; }

        /// <summary>
        /// 创建人
        /// </summary>
        public string? CreateBy { get; set; }

        /// <summary>
        /// 创建时间
        /// </summary>
        public DateTime? CreateTime { get; set; }

        /// <summary>
        /// 修改人
        /// </summary>
        public string? UpdateBy { get; set; }

        /// <summary>
        /// 修改时间
        /// </summary>
        public DateTime? UpdateTime { get; set; }

        /// <summary>
        /// 计划关联产品列表
        /// </summary>
        public List<PlanProductDto> Items { get; set; } = new List<PlanProductDto>();
    }

    /// <summary>
    /// 生产计划明细DTO
    /// </summary>
    public class PlanItemDto
    {
        /// <summary>
        /// 主键ID
        /// </summary>
        public int Id { get; set; }

        /// <summary>
        /// 所属计划ID
        /// </summary>
        public int PlanId { get; set; }

        /// <summary>
        /// 产品编号
        /// </summary>
        public string ProductCode { get; set; }

        /// <summary>
        /// 产品名称
        /// </summary>
        public string ProductName { get; set; }

        /// <summary>
        /// 规格
        /// </summary>
        public string? Spec { get; set; }

        /// <summary>
        /// 计划数量
        /// </summary>
        public int Quantity { get; set; }

        /// <summary>
        /// 完成数量
        /// </summary>
        public int? DoneQuantity { get; set; }

        /// <summary>
        /// 对应工单编号
        /// </summary>
        public string? WorkOrderCode { get; set; }

        /// <summary>
        /// 创建时间
        /// </summary>
        public DateTime? CreateTime { get; set; }

        /// <summary>
        /// 修改时间
        /// </summary>
        public DateTime? UpdateTime { get; set; }
    }

    /// <summary>
    /// 生产计划列表DTO
    /// </summary>
    public class PlanDto
    {
        /// <summary>
        /// 主键ID
        /// </summary>
        public int Id { get; set; }

        /// <summary>
        /// 计划单号
        /// </summary>
        public string Code { get; set; }

        /// <summary>
        /// 备注
        /// </summary>
        public string? Remark { get; set; }

        /// <summary>
        /// 创建人
        /// </summary>
        public string? CreateBy { get; set; }

        /// <summary>
        /// 创建时间
        /// </summary>
        public DateTime? CreateTime { get; set; }

        /// <summary>
        /// 修改人
        /// </summary>
        public string? UpdateBy { get; set; }

        /// <summary>
        /// 修改时间
        /// </summary>
        public DateTime? UpdateTime { get; set; }

        /// <summary>
        /// 明细数量统计
        /// </summary>
        public int ItemCount { get; set; }
    }

    /// <summary>
    /// 产品选择DTO（用于明细选择产品）
    /// </summary>
    public class ProductSelectDto
    {
        /// <summary>
        /// 产品ID
        /// </summary>
        public int Id { get; set; }

        /// <summary>
        /// 产品编号
        /// </summary>
        public string Code { get; set; }

        /// <summary>
        /// 产品名称
        /// </summary>
        public string Name { get; set; }

        /// <summary>
        /// 规格
        /// </summary>
        public string? Spec { get; set; }

        /// <summary>
        /// 库存位置
        /// </summary>
        public string? Location { get; set; }
    }

    /// <summary>
    /// 计划关联产品DTO（用于显示计划下的产品信息）
    /// </summary>
    public class PlanProductDto
    {
        /// <summary>
        /// 产品ID
        /// </summary>
        public int Id { get; set; }

        /// <summary>
        /// 关联的计划ID
        /// </summary>
        public int? PlanId { get; set; }

        /// <summary>
        /// 产品编号
        /// </summary>
        public string ProductCode { get; set; }

        /// <summary>
        /// 产品名称
        /// </summary>
        public string ProductName { get; set; }

        /// <summary>
        /// 规格
        /// </summary>
        public string? Spec { get; set; }

        /// <summary>
        /// 单位
        /// </summary>
        public string? Unit { get; set; }

        /// <summary>
        /// 生产人员
        /// </summary>
        public string? Producer { get; set; }

        /// <summary>
        /// 生产开始时间
        /// </summary>
        public DateTime ProductionStartTime { get; set; }

        /// <summary>
        /// 生产结束时间
        /// </summary>
        public DateTime ProductionEndTime { get; set; }

        /// <summary>
        /// 创建时间
        /// </summary>
        public DateTime? CreateTime { get; set; }

        /// <summary>
        /// 修改时间
        /// </summary>
        public DateTime? UpdateTime { get; set; }
    }
} 